<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>更新员工</title>
</head>
<body>
<form th:action="@{/updateEmp}" method="post">
    <input type="hidden" name="id" th:value="${emp.getId()}">
    员工名字<input type="text" th:value="${emp.getLastname()}" name="lastname"><br>
    邮箱<input type="text" name="email" th:value="${emp.getEmail()}"><br>
    男<input type="radio" name="gender" value="1" th:checked="${emp.getGender()==1}">
    女<input type="radio" name="gender" value="0" th:checked="${emp.getGender()==0}">
    <!--    对象中的对象，提交其中一个属性-->
    部门<select  name="department.id">
        <option th:selected="${dept.getId()==emp.getDepartment().getId()}" th:each="dept:${departments}" th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
        </select>
    生日<input th:value="${emp.getBirth()}" type="text" name="birth">
    <input type="submit" value="修改">
    <p style="color: red"></p>

</form>
</body>
</html>
